home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / hewin / ccisrc / lib.h < prev    next >
C/C++ Source or Header  |  1993-11-30  |  7KB  |  240 lines

  1. /*************************************************************************
  2. *    CCI 用ライブラリ・ヘッダファイル
  3. *************************************************************************/
  4. #ifndef    _LIB_H
  5. #define    _LIB_H
  6.  
  7. /*    "stdio.h"        ------------------------------------------------*/
  8. #ifndef    SEEK_SET
  9. #define    SEEK_SET    (0)    /* From_beginning    */
  10. #define    SEEK_CUR    (1)    /* From_current        */
  11. #define    SEEK_END    (2)    /* From_end            */
  12. #endif
  13.  
  14. #ifndef    BUFSIZ
  15. #    define    BUFSIZ        (512)
  16. #endif
  17.  
  18. /*    "time.h"        ------------------------------------------------*/
  19. #ifndef    CLOCKS_PER_SEC
  20. #    define    CLOCKS_PER_SEC    100
  21. #endif
  22.  
  23. #ifndef    CANCEL
  24. #    define    CANCEL    (-1)
  25. #endif
  26.  
  27. #ifndef    C_BLACK
  28. #define    C_BLACK        0
  29. #define    C_BLUE        1
  30. #define    C_RED        2
  31. #define    C_MAGENTA    3
  32. #define    C_GREEN        4
  33. #define    C_CYAN        5
  34. #define    C_YELLOW    6
  35. #define    C_WHITE        7
  36. #define    C_HBLACK    8
  37. #define    C_HBLUE        9
  38. #define    C_HRED        10
  39. #define    C_HMAGENTA    11
  40. #define    C_HGREEN    12
  41. #define    C_HCYAN        13
  42. #define    C_HYELLOW    14
  43. #define    C_HWHITE    15
  44.  
  45. #define    C_THROUGH    0
  46. #define    C_MBLACK    1
  47. #endif
  48.  
  49. #ifndef    PSET
  50. #define    PSET    0
  51. #define    PRESET    1
  52. #define    OR        2
  53. #define    AND        3
  54. #define    XOR        4
  55. #define    NOT        5
  56. #define    OPAQUE    9
  57. #endif
  58.  
  59. #ifndef    MASKSET
  60. #define    MASKSET        13
  61. #define    MASKRESET    14
  62. #define    MASTNOT        15
  63. #endif
  64.  
  65. #ifndef    COLMIX
  66. #define    COLMIX(c1,c2)    (0x1000|(((c1)&15)<<4)|((c2)&15))
  67. #endif
  68.  
  69. /*************************************************************************
  70. *    キー入力,かな漢字変換システム用
  71. *************************************************************************/
  72.  
  73. #ifndef    KAN_ROUMAZIOFF
  74. #define    KAN_ROUMAZIOFF    0x00000010
  75. #define    KAN_ROUMAZI        0x00000020
  76. #define    KAN_HANKAKU        0x00000040
  77. #define    KAN_ZENKAKU        0x00000080
  78. #define    KAN_EISUU        0x00000100
  79. #define    KAN_KATAKANA    0x00000200
  80. #define    KAN_HIRAGANA    0x00000400
  81. #define    KAN_MODELOCKOFF    0x00000000
  82. #define    KAN_MODELOCK    0x00010000
  83. #define    KAN_EISYOU        0x00000000
  84. #define    KAN_EIDAI        0x00020000
  85. #endif
  86.  
  87. #ifndef    _KAN_KM
  88. #define    _KAN_KM
  89. int    _kan_km;
  90. #endif
  91.  
  92. #ifndef    KAN_SETMODE_HAN
  93. #define    KAN_SETMODE_HAN()    KBF_kan_setMode(KAN_HANKAKU|KAN_EISUU|KAN_EISYOU)
  94. #endif
  95.  
  96. #ifndef    KAN_SETMODE_JNP
  97. #define    KAN_SETMODE_JNP()    \
  98.     _kan_km = KBF_kan_getMode();                                    \
  99.     if ( _kan_km < 0 ) { KBF_kan_on(); _kan_km = KBF_kan_getMode();    \
  100.     _kan_km = (_kan_km & 0xFFFFF0FF) | KAN_HIRAGANA;                \
  101.     KBF_kan_setMode(_kan_km);
  102. #endif
  103.  
  104. /*************************************************************************
  105. *    マウス
  106. *************************************************************************/
  107.  
  108. #ifndef    MOS_CON
  109. #define    MOS_CON()    MOS_curDisp(1)
  110. #define    MOS_COFF()    MOS_curDisp(0)
  111. #define    MOS_DEC()    MOS_curDisp(2)
  112. #define    MOS_INC()    MOS_curDisp(3)
  113. #endif
  114.  
  115. /*************************************************************************
  116. *    イベント処理用
  117. *************************************************************************/
  118.  
  119. #define    GET_EVTSBJ_PTR(sbj)    GetEvtSbjPtr(sbj)
  120. /*    構造体がつかえるようになれば sbj->ptr でOk    */
  121.  
  122. #ifndef    EVT_CANCEL
  123. #define    EVT_CANCEL    (-1)
  124. #define    EVT_BREAK    (-2)
  125. #endif
  126.  
  127. #ifndef    EVTIGN_MOUSE
  128. #define    EVTIGN_MOUSE    (1)        /* マウスイベント禁止    */
  129. #define    EVTIGN_KEY        (2)        /* キーイベント禁止        */
  130. #endif
  131.  
  132. #ifndef    EVTYPE_KEY
  133. #define    EVTYPE_KEY        (1)
  134. #define    KEYEVT_ADR        (0)    /* キーアドレスが一致        */
  135. #define    KEYEVT_SHIFT    (1)    /* キーシフトも一致            */
  136. #endif
  137.  
  138. #ifndef    EVTYPE_MOUSE
  139. #define    EVTYPE_MOUSE    (2)
  140. #define    EVTYPE_MOS2        (3)    /* page 0 用マウスイベント    */
  141. #endif
  142.  
  143. #ifndef    BTN_LEFT
  144. #define    BTN_LEFT        (1)
  145. #define    BTN_RIGHT        (2)
  146. #define    MOSEVT_BTN        (0x01)    /* ボタンタイプ                    */
  147. #define    MOSEVT_NOT        (0x02)    /* ボタン反転タイプ                */
  148. #define    MOSEVT_NOACT    (0x03)    /* ボタン選択アクションなし        */
  149. #define    MOSEVT_AREA        (0x04)    /* 指定エリア                    */
  150. #define    MOSEVT_OUTAREA    (0x05)    /* 指定エリア外                    */
  151. #define    MOSEVT_BTNOLY    (0x06)    /* ボタンが押された場合            */
  152. #define    MOSEVT_MOVE        (0x07)    /* カーソルに移動があった場合    */
  153. #define    MOSEVT_OUTBTN    (0x08)    /* 範囲外でボタンON                */
  154.  
  155. #define    MOSEVT_REPEAT    (0x10)    /* リピートタイプ(ボタン)        */
  156. #define    MOSEVT_QUICK    (0x10)    /* クイックタイプ(リピートと同じ)    */
  157. #endif
  158.  
  159. /*************************************************************************
  160. *    ダイアログ用
  161. *************************************************************************/
  162.  
  163. #ifndef    DLGPOS_MOS_SET_HOME
  164. #define    DLGPOS_MOS_SET_HOME        (0x10010)    /* マウス位置(左上)    */
  165. #define    DLGPOS_MOS_SET_CENTER    (0x10020)    /* マウス位置中央        */
  166. #define    DLGPOS_CENTER_OF_SCN    (0x10030)    /* 画面中央                */
  167. #endif
  168.  
  169. #ifndef    DLGMSG_POS_CONTINUE
  170. #define    DLGMSG_POS_CONTINUE        (-1)
  171. #define    DLGMSG_POS_CENTERING    (-2)
  172. #endif
  173.  
  174. /*************************************************************************
  175. *    メニュー処理用
  176. *************************************************************************/
  177.  
  178. /*    "apl028.h"        ------------------------------------------------*/
  179. #ifndef    MNU_BLK
  180. #define    MNU_BLK    (0)
  181. #define    MNU_MSG    (1)
  182. #define    MNU_NOR    (2)
  183. #define    MNU_DIG    (3)
  184. #define    MNU_STR    (4)
  185. #define    MNU_SEL    (5)
  186. #define    MNU_IGN    (0x80)    /* 実行禁止    */
  187.  
  188. #define    MNUATT_EXIT    (1)        /* EXIT ボタン付    */
  189. #define    MNUATT_LOOP    (2)        /* LOOP フラグ        */
  190. #endif
  191.  
  192. /*    check!!    "menu.h"    */
  193. #ifndef    MENU_SURE_OK
  194. #define    MENU_SURE_OK        (1)
  195. #define    SELBTN_ATT_LEFT        (0)    /* 左詰め表示                */
  196. #define    SELBTN_ATT_CENTER    (1)    /* メッセージのセンタリング    */
  197. #endif
  198.  
  199. /*************************************************************************
  200. *    ファイルダイアログ
  201. *************************************************************************/
  202.  
  203. #ifndef    FSORT_RVS
  204. #    define    FSORT_RVS    (0x80)
  205. #    define    FSORT_OFF    (0)
  206. #    define    FSORT_FILE    (1)
  207. #    define    FSORT_SUB    (2)
  208. #    define    FSORT_DATE    (3)
  209. #endif
  210.  
  211.  
  212. /*************************************************************************
  213. *    時間表記
  214. *************************************************************************/
  215.  
  216. #ifndef    TM_SEC
  217. #define    TM_SEC(tm)        (tm[0])    /* 0...59        */
  218. #define    TM_MIN(tm)        (tm[1])    /* 0...59        */
  219. #define    TM_HOUR(tm)        (tm[2])    /* 0...23        */
  220. #define    TM_MDAY(tm)        (tm[3])    /* 1...31        */
  221. #define    TM_MON(tm)        (tm[4])    /* 0...11        */
  222. #define    TM_YEAR(tm)        (tm[5])    /* 1900...        */
  223. #define    TM_WDAY(tm)        (tm[6])    /* Sunday 0...6    */
  224. #define    TM_YDAY(tm)        (tm[7])    /* 0...365        */
  225. #define    TM_ISDST(tm)    (tm[8])    /* daylight     */
  226. #endif
  227.  
  228. /*************************************************************************
  229. *    RS-232C
  230. *************************************************************************/
  231.  
  232. #define    NTM_RSRESET()    NTM_rsPause( 0 )
  233. #define    NTM_RSPAUSE()    NTM_rsPause( 1 )
  234. #define    NTM_RSDEC()        NTM_rsPause( 2 )
  235. #define    NTM_RSINC()        NTM_rsPause( 3 )
  236. #define    NTM_RSDEC2()    NTM_rsPause( 4 )
  237. #define    NTM_RSINC2()    NTM_rsPause( 5 )
  238.  
  239. #endif
  240.